#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n;
struct node
{
    ll num, grade, a, sum;
}g[60];
bool cmp1(node n1, node n2)
{
    return n1.a < n2.a;
}
bool cmp2(node n1, node n2)
{
    return n1.sum == n2.sum ? n1.a > n2.a : n1.sum > n2.sum;
}
int main()
{
    // 请在此输入您的代码
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n;
    for(ll i = 1; i <= n; i++)
        cin >> g[i].grade;
    for(ll i = 1; i <= n; i++)
    {
        cin >> g[i].a;
        g[i].num = i;
    }
    sort(g + 1, g + n + 1, cmp1);
    for(ll i = 1; i <= n; i++)
        g[i].sum = n - g[i].grade + 1 + i;
    sort(g + 1, g + n + 1, cmp2);
    for(ll i = 1; i <= n; i++)
        cout << i << ":MU000" << g[i].num << '(' << g[i].sum << ')' << "\n";
    return 0;
}